import Cookies from 'js-cookie'

const tokenKey = 'admin_access_token'

export const getToken = (): string | undefined => Cookies.get(tokenKey)
export const setToken = (token: string): void =>
  Cookies.set(tokenKey, token, { expires: 0.5, path: process.env.BASE_URL })
export const removeToken = (): void =>
  Cookies.remove(tokenKey, { path: process.env.BASE_URL })
